<!--#layout("/common/layout.html",{"jsBase":"/js/live/courseLive/"}){ -->
<div class="layui-row">
    <form id="searchForm" class="layui-form layui-form-pane">
        <div class="layui-collapse" lay-filter="condictionCol">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title">查询条件</h2>
                <div class="layui-colla-content layui-show">
                    <div class="layui-row">

                        <div class="layui-form-item">
                            <div class="layui-inline">

                                <label class="layui-form-label">开始时间</label>
                                <div class="layui-input-inline">
                                    <div class="date-range-pick">
                                        <input type="text" name="startTimeQuery" autocomplete="off" class="layui-input input-date" >
                                    </div>
                                </div>


                                <label class="layui-form-label">直播状态</label>
                                <div class="layui-input-inline">
                                    <select style="width:40%"  name="liveStatus" selectValue="" promtion="请选择" lay-search>
                                        <option value="">请选择</option>
                                        <option value="1">预约</option>
                                        <option value="2">直播中</option>
                                        <option value="3">回看</option>
                                    </select>

                                </div>

                                <label class="layui-form-label">在线状态</label>

                                <div class="layui-input-inline">
                                    <select style="width:40%"  name="courseStatus" id="courseStatus" selectValue="" promtion="请选择" lay-search>
                                        <option value="">请选择</option>
                                        <option value="1">上线</option>
                                        <option value="0">下线</option>
                                    </select>
                                </div>

                            </div>
                        </div>

                        <div class="layui-form-item">
                            <div class="layui-inline">


                                <label class="layui-form-label">直播主题</label>

                                <div class="layui-input-inline">
                                    <input type="text" name="liveTitle" autocomplete="off" class="layui-input">
                                </div>
                                <!--#if(accessType==6){ -->
                                <label class="layui-form-label">归属省份</label>
                                <div class="layui-input-inline">
                                    <layui:simpleDataSelect name="provinceId" id="provinceId"  data="${provinceList}"
                                                            attrId="provId" attrName="provName" laySearch="true" layFilter="colFilter"/>
                                </div>
                                <!--#} -->
                                <label class="layui-form-label">课程老师</label>
                                <div class="layui-input-inline">
                                    <select style="width:40%" class="select" name="teacherId" id="teacherId" selectValue="" promtion="请选择" lay-search>
                                        <option value="">请选择</option>
                                    </select>
                                </div>

                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">直播类型</label>
                            <layui:simpleDictSelect style='layui-input-inline' type="LIVE_TYPE" layVerify="required"
                                                    id="liveType" name="liveType" value="" />
                            <button style="float: right;" class="layui-btn layui-btn-normal" type="button" id="searchFormSearch">搜索</button>
                        </div>
                    </div>
                    <!--
                     <div class="layui-inline" style="width:100%">
                                <label class="layui-form-label">生成订单时间</label>
                                <div class="layui-input-inline">
                                    <div class="date-range-pick">
                                        <input type="text" name="orderTime" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                    <button style="float: right;" class="layui-btn layui-btn-normal" type="button" id="searchFormSearch">搜索</button>

                            </div>
                    <div class="layui-row">
                        <div class="layui-form-item " style="float: right;">
                            <button class="layui-btn layui-btn-normal" type="button" id="searchFormSearch">搜索</button>
                        </div>
                    </div>
                    -->
                </div>
            </div>
        </div>
    </form>
</div>

<div class="layui-btn-group">
    <layui:accessButton function="live.courseLive.add" action="add">增加</layui:accessButton>
    <layui:accessButton function="live.courseLive.edit" action="edit">编辑</layui:accessButton>
    <layui:accessButton function="live.courseLive.del" action="del">删除</layui:accessButton>
    <layui:accessButton function="live.courseLive.up" action="up">上线</layui:accessButton>
    <layui:accessButton function="live.courseLive.down" action="down">下线</layui:accessButton>
    <layui:accessButton function="live.courseLive.record" action="record">预约记录</layui:accessButton>
    <layui:accessButton function="live.courseLive.entrance" action="entrance">直播入口</layui:accessButton>
</div>

<table id="courseLiveTable" lay-filter="courseLiveTable"></table>
<!--#} -->
<script>
    layui.use(['index','form'], function () {
        var index = layui.index,
            form = layui.form;
        index.init();

        form.on('select(colFilter)', function(data){
            setAuthor(data.value);
        });

        setAuthor("${provinceId}");

        function setAuthor(id) {
            $.ajax({
                type: 'POST',
                url: "${ctxPath}/content/resContentMain/getAuthor.json",
                data: {
                    provinceId:id
                },
                dataType:'json',
                success: function(data){
                    $("#teacherId").html("");
                    $("#teacherId").append($("<option>").val("").text("请选择"));
                    $.each(data.data, function(key, val) {
                        var option1 = $("<option>").val(val.customerId).text(val.customerName);
                        $("#teacherId").append(option1);
                    });
                    form.render('select');
                }
            });
        }
    });

</script>
